<?php

namespace App\HttpController\Api;

use EasySwoole\Http\AbstractInterface\Controller;
use EasySwoole\Http\Message\Status;
use EasySwoole\Validate\Validate;

class Video extends Controller
{
    public function index()
    {

    }

    public function add()
    {
        $params = $this->request()->getRequestParam();
        $validate = new Validate();
        $validate->addColumn('name', '名称')->required('名称不能为空');
        if (!$this->validate($validate)) {
            return $this->writeJson(Status::CODE_BAD_REQUEST, $validate->getError()->__toString(), 'fail');
        }
    }
}